//
//  ThemePicker.swift
//  codelabs
//
//  Created by 雷雷 on 25/05/2025.
//

import SwiftUI
import ThemeKit

struct ThemePicker: View {
    @Binding var selected:Theme
    
    var body: some View {
        Picker("Theme",selection: $selected){
            ForEach(Theme.allCases){theme in
                ThemeView(theme:theme)
                    .tag(theme)
            }
        }
        .pickerStyle(.navigationLink)
    }
}

#Preview {
    @Previewable @State var theme:Theme = .buttercup

    NavigationStack{
        ThemePicker(selected: $theme)
    }
}
